package com.example.springdemo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Wenyi Luo
 * @ClassName JsonTest
 * @Description TODO
 * @date 22/3/1 21:28
 * @version: 1.0
 */
@Controller
@RequestMapping("/param")
public class JsonTest {
    /**
     * 测试接收json数据
     */
    private static final Logger logger = LoggerFactory.getLogger(JsonTest.class);

    @RequestMapping(value = "/add", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    public String addUser(String name, String pwd) {
        logger.debug("name:" + name + ",pwd:" + pwd);
        System.out.println(name+" "+pwd);
        return "name:" + name + ",pwd:" + pwd;

    }


}
